package com.xxx.gmail.UI;

import javax.swing.JFrame;
import javax.swing.JInternalFrame;
import javax.swing.ListSelectionModel;
import javax.swing.table.AbstractTableModel;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableModel;

import com.gmail.wangzdl.swing.jframe.TestInternalFrame;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.util.ArrayList;
import java.util.Arrays;

public class CustomerListPane extends BaseListPane {
	private ArrayList model;
	AbstractTableModel tm = new DefaultTableModel(
			new Object[][] {
					{"1", "Tom", "18", "8899778", "bXXXXX", "M"},
					{"2", "Dave", "22", "2233445", "axxxxx", "M"},
					{"3", "Lisa", "20", "3233344", "", "F"}
				},
				new String[] {
					"ID", "Name", "Age", "phone", "address", "sex"
				}
			);
	AbstractTableModel tm1 = new DefaultTableModel(
			new Object[][] {
					{"1", "Tom", "18", "8899778", "bXXXXX", "M"},
					{"2", "Dave", "22", "2233445", "axxxxx", "M"},
					{"3", "Lisa", "20", "3233344", "", "F"}
				},
				new String[] {
					"ID", "Name", "Age", "phone", "address", "sex"
				}
			);
	public CustomerListPane() {

		table.setModel(tm);
		button_7.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				ArrayList al = new ArrayList();
				int[] aa=table.getSelectedRows();
				for (int i = 0; i < aa.length; i++) {
						//al.add(model.get(aa[i]));
				}
				//CustomerDetailsFrm cdf= new CustomerDetailsFrm();
				//cdf.setVisible(true);
				CustomerDetailsDlg dialog = new CustomerDetailsDlg();
				dialog.setVisible(true);
				//JInternalFrame jif= new TestInternalFrame();
				//jif.setVisible(true);

				table.setModel(tm1);
				//tm1.fireTableDataChanged();
				

			
			}
		}
		);
		
	}

}
